package com.dubbo.cp.provider.serviceImpl;

import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import com.dubbo.cp.entity.UserEntity;
import com.dubbo.cp.provider.mapper.UserMapper;
import com.dubbo.cp.service.UserService;

@Service
public class UserServiceImpl implements UserService{
	@Autowired
	UserMapper userMapper;
	
	@Override
	public String getUser() {
		UserEntity u=userMapper.findUserByUserid(1);
		return u.getUsername();
	}

	@Override
	public UserEntity getUserByUsername(String username) {
		UserEntity u=userMapper.findUserByUsername(username);
		if(u!=null) {
			return u;
		}
		return null;
	}

}
